
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies","go_repository")


def go_repository_zip():
    domain_prefix = "http://localhost:8888/resp/"
#    go_repository(
#        name = "org_golang_x_tools",
#        importpath = "golang.org/x/tools",
#        remote = "https://gitee.com/whatdy/org_golang_x_tools",
#        # tag = "master"
#        commit = "e377ae9d63860e3b8f606b92a1a7c7df5b14ca67",  # master, as of 2019-07-20
#        patches = [
#            "@io_bazel_rules_go//third_party:org_golang_x_tools-gazelle.patch",
#            "@io_bazel_rules_go//third_party:org_golang_x_tools-extras.patch",
#        ],
#        patch_args = ["-p1"],
#        vcs = "git",
#     )
#    return
    # https://codeload.github.com/golang/tools/zip/e377ae9d63860e3b8f606b92a1a7c7df5b14ca67
    go_repository(
        name = "org_golang_x_tools",
        importpath = "golang.org/x/tools",
        urls = [
            domain_prefix+"tools/tools-e377ae9d63860e3b8f606b92a1a7c7df5b14ca67"
        ],
        strip_prefix = "tools-e377ae9d63860e3b8f606b92a1a7c7df5b14ca67", # master, as of 2019-07-20
        patch_args = ["-p1"],
        type = "zip",
        patches = [
            # "@io_bazel_rules_go//third_party:org_golang_x_tools-gazelle.patch",
            "@io_bazel_rules_go//third_party:org_golang_x_tools-extras.patch",
        ],
    )

    # https://codeload.github.com/protocolbuffers/protobuf/zip/582743bf40c5d3639a70f98f183914a2c0cd0680
    go_repository(
        name = "com_google_protobuf",
        importpath = "github.com/protocolbuffers/protobuf",
        urls = [
            domain_prefix+"protobuf-582743bf40c5d3639a70f98f183914a2c0cd0680"
        ],
        strip_prefix = "protobuf-582743bf40c5d3639a70f98f183914a2c0cd0680", # v3.7.0,     as of 2019-03-03
        type = "zip",
    )
    # https://codeload.github.com/golang/net/zip/16b79f2e4e95ea23b2bf9903c9809ff7b013ce85

    go_repository(
        name = "org_golang_x_net",
        importpath = "golang.org/x/net",
        urls = [
            domain_prefix+"net-16b79f2e4e95ea23b2bf9903c9809ff7b013ce85"
        ],
        strip_prefix = "net-16b79f2e4e95ea23b2bf9903c9809ff7b013ce85", # v3.7.0,     as of 2019-03-03
        patches = ["@io_bazel_rules_go//third_party:org_golang_x_net-gazelle.patch"],
        patch_args = ["-p1"],
        type = "zip",
    )
    # https://codeload.github.com/google/go-genproto/zip/4f5b463f9597cbe0dd13a6a2cd4f85e788d27508
    go_repository(
        name = "org_golang_google_genproto",
        importpath = "github.com/google/go-genproto",
        urls = [
            domain_prefix+"go-genproto-4f5b463f9597cbe0dd13a6a2cd4f85e788d27508"
        ],
        strip_prefix = "go-genproto-4f5b463f9597cbe0dd13a6a2cd4f85e788d27508",  # master, as of 2019-03-03
        patches = ["@io_bazel_rules_go//third_party:org_golang_google_genproto-gazelle.patch"],
        patch_args = ["-p1"],
        type = "zip",
    )
    # https://codeload.github.com/gogo/protobuf/zip/ba06b47c162d49f2af050fb4c75bcbc86a159d5c
    go_repository(
        name = "com_github_gogo_protobuf",
        importpath = "github.com/gogo/protobuf",
        urls = [
            domain_prefix+"protobuf-ba06b47c162d49f2af050fb4c75bcbc86a159d5c"
        ],
        strip_prefix = "protobuf-ba06b47c162d49f2af050fb4c75bcbc86a159d5c",  # v1.2.1, as of 2019-03-03
        patches = ["@io_bazel_rules_go//third_party:com_github_gogo_protobuf-gazelle.patch"],
        patch_args = ["-p1"],
        type = "zip",
    )
    # https://codeload.github.com/golang/text/zip/f21a4dfb5e38f5895301dc265a8def02365cc3d0

    go_repository(
        name = "org_golang_x_text",
        importpath = "golang.org/x/text",
        urls = [
            domain_prefix+"text-f21a4dfb5e38f5895301dc265a8def02365cc3d0"
        ],
        strip_prefix = "text-f21a4dfb5e38f5895301dc265a8def02365cc3d0",   # v0.3.0, latest as of 2019-03-03
        patches = ["@io_bazel_rules_go//third_party:org_golang_x_text-gazelle.patch"],
        patch_args = ["-p1"],
        type = "zip",
    )
    # https://codeload.github.com/grpc/grpc-go/zip/2fdaae294f38ed9a121193c51ec99fecd3b13eb7
    go_repository(
        name = "org_golang_google_grpc",
        importpath = "github.com/grpc/grpc-go",
        urls = [
            domain_prefix+"grpc-go-2fdaae294f38ed9a121193c51ec99fecd3b13eb7"
        ],
        strip_prefix = "grpc-go-2fdaae294f38ed9a121193c51ec99fecd3b13eb7",  # v1.19.0, latest as of 2019-03-03
        patches = [
#           "@io_bazel_rules_go//third_party:org_golang_google_grpc-gazelle.patch",
#           "@io_bazel_rules_go//third_party:org_golang_google_grpc-crosscompile.patch",
        ],
        patch_args = ["-p1"],
        type = "zip",
    )

    # https://codeload.github.com/googleapis/googleapis/zip/41d72d444fbe445f4da89e13be02078734fb7875
    go_repository(
        name = "go_googleapis",
        importpath = "github.com/googleapis/googleapis",
        urls = [
            domain_prefix+"googleapis-41d72d444fbe445f4da89e13be02078734fb7875"
        ],
        strip_prefix = "googleapis-41d72d444fbe445f4da89e13be02078734fb7875",  # master, as of 2019-03-03
        patches = [
#            "@io_bazel_rules_go//third_party:go_googleapis-deletebuild.patch",
#            "@io_bazel_rules_go//third_party:go_googleapis-directives.patch",
#            "@io_bazel_rules_go//third_party:go_googleapis-gazelle.patch",
            "@io_bazel_rules_go//third_party:go_googleapis-fix.patch",
        ],
        patch_args = ["-E", "-p1"],
        type = "zip",
    )
    # https://codeload.github.com/golang/protobuf/zip/c823c79ea1570fb5ff454033735a8e68575d1d0f
    go_repository(
        name = "com_github_golang_protobuf",
        importpath = "github.com/golang/protobuf",
        urls = [
            domain_prefix+"protobuf-c823c79ea1570fb5ff454033735a8e68575d1d0f"
        ],
        strip_prefix = "protobuf-c823c79ea1570fb5ff454033735a8e68575d1d0f",  # v1.3.0, as of 2019-03-03
        patch_args = ["-p1"],
        patches = [
#            "@io_bazel_rules_go//third_party:com_github_golang_protobuf-gazelle.patch",
#            "@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch",
        ],
        type = "zip",
    )
    # https://codeload.github.com/golang/sys/zip/d455e41777fca6e8a5a79e34a14b8368bc11d9ba
    go_repository(
        name = "org_golang_x_sys",
        importpath = "golang.org/x/sys",
        urls = [
            domain_prefix+"sys-d455e41777fca6e8a5a79e34a14b8368bc11d9ba"
        ],
        strip_prefix = "sys-d455e41777fca6e8a5a79e34a14b8368bc11d9ba",  # master, as of 2019-03-03
        patch_args = ["-p1"],
        patches = ["@io_bazel_rules_go//third_party:org_golang_x_sys-gazelle.patch"],
        type = "zip",
    )
    gazelle_dependencies()
